package com.lanxin.stu.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Positive;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * @author cyh
 * @create 2025-09-17 9:54
 */
@Data
@ApiModel(value = "修改学生对象")
public class StudentDTO implements Serializable {

    @ApiModelProperty(value = "学生编号",required = true)
    @NotNull(message = "学生编号不能为空")
    @Positive(message = "学生编号不正确")
    private Integer id;

    @ApiModelProperty(value = "班级编号",required = true)
    @NotNull(message = "班级编号不能为空")
    @Positive(message = "班级编号不正确")
    private Integer cid;

    @ApiModelProperty(value = "学生名称",required = true)
    @NotBlank(message = "学生名称不能为空")
    private String stuname;

    @ApiModelProperty(value = "学生年龄",required = true)
    @NotNull(message = "学生年龄不能为空")
    @Positive(message = "学生年龄不正确")
    private Integer age;

    @ApiModelProperty(value = "学生性别",required = true)
    @NotBlank(message = "学生性别不能为空")
    private String sex;

    @ApiModelProperty(value = "学生生日")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Past(message = "生日不能为未来时间")
    private LocalDate birthday;

    @ApiModelProperty(value = "学生地址")
    private String address;
}
